from qiniu import Auth, put_data
import qiniu.config


def upload_pictures(image):

    # 需要填写你的 Access Key 和 Secret Key
    access_key = 'Q37HmIggK50aAKsIgIHVf4lf1_VYLLK1ye2PvU15'
    secret_key = 'Z2OVhEjHc4v5xg2R50GVobON48Ki3pUMYyJP36op'
    # 构建鉴权对象
    q = Auth(access_key, secret_key)
    # 要上传的空间
    bucket_name = 'zzzihome'
    # 上传后保存的文件名
    key = None
    # 生成上传 Token，可以指定过期时间等
    token = q.upload_token(bucket_name, key, 3600)
    ret, info = put_data(token, key, image)
    return ret, info
